﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.UserCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.UserHandler
{
    public class UserLoginCommandHandler : IRequestHandler<UserLoginCommand, UserInfo>
    {
        IUserService User;

        public UserLoginCommandHandler(IUserService User)
        {
            this.User = User;
        }

        public async Task<UserInfo> Handle(UserLoginCommand request, CancellationToken cancellationToken)
        {
            return await User.GeLohin(request.accountNumber, request.password);
        }
    }
}
